<?php
require_once 'database.php';
require_once 'common.php';

session_start();
$intAccountId = getUserIdFromUsername($_SESSION['user']);

//Get information from the post
$intProjectId = $_POST['project_id'];
$strProjectName = $_POST['project_name'];

//Update the project
$dbResult = mysql_query("UPDATE project SET project_name='$strProjectName' WHERE project_id=$intProjectId");

$intRows = mysql_affected_rows();

$objReturn = array();

$objReturn['code'] = "SUCCESS";
$objReturn['project_id'] = $intProjectId;

header("content-type:application/json");
echo json_encode($objReturn);
